package com.boot.service;

import com.boot.entity.User;
import com.boot.mapper.UserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public List<User> list(Integer current,Integer pageSize){
        //分页的其实页 默认是0
        Integer start = 0;
        if(current > 0){
            start = ( current -1  ) * pageSize;
        }

        return userMapper.list(start,pageSize);
    }

    public int count(){
        return userMapper.count();
    }
}
